//
//@File    :	6.1_if.cpp
//@Time    :	2021/08/07 18:35:09
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	using the if statement.输出空格数和字符数
//

#include <iostream>

int main()
{
    using namespace std;
    char ch;
    int spaces = 0;
    int total = 0;
    cin.get(ch);
    while (ch != '.')
    {
        if(ch == ' ')
        {
            ++spaces;
        }
        ++total;
        cin.get(ch);
    }
    cout<<spaces<<" spaces, "<<total;
    cout<<" characters total in sentence\n";
    
    system("pause");
    return 0;
}